package com.zhangmeng.online.exam.ui.components.callBack;

import com.zhangmeng.online.exam.ui.api.DataLoad;
import com.zhangmeng.online.exam.ui.api.model.ExamDataLoad;
import com.zhangmeng.online.exam.ui.utils.ApiUtils;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.ObservableList;

import java.util.Map;

/**
 * @author zm
 * @date 2025/4/17 16:50
 * @version: 1.0
 */
public class SendPaperComponentCallBackImpl implements SendPaperComponentCallBack {


    @Override
    public ApiUtils.DataView loadPaperData(int pageNum, int pageSize) {
        ExamDataLoad dataLoad = new ExamDataLoad();
        return dataLoad.loadPaperData(pageNum, pageSize);
    }

    @Override
    public ApiUtils.DataView loadPaperData(Map<String, Object> context, int pageNum, int pageSize) {
        ExamDataLoad dataLoad = new ExamDataLoad();
        return dataLoad.loadPaperData(context,pageNum, pageSize);
    }

    @Override
    public ApiUtils.DataView searchPaperData(String searchText, int pageNum, int pageSize) {
        ExamDataLoad dataLoad = new ExamDataLoad();
        return dataLoad.searchPaperData(searchText, pageNum, pageSize);
    }

    @Override
    public ApiUtils.DataView loadChoosePaperData(Map<String, Object> context, int pageNum, int pageSize) {
        ExamDataLoad dataLoad = new ExamDataLoad();
        return dataLoad.loadChoosePaperData(context, pageNum, pageSize);
    }

    @Override
    public void commitChoosePaper(Map<String, Object> context, ObservableList<Map<String, SimpleStringProperty>> chooseTableData) {
        ExamDataLoad dataLoad = new ExamDataLoad();
        dataLoad.commitChoosePaper(context, chooseTableData);
    }
}
